from django.db import models

# Create your models here.
class Department(models.Model):
    title = models.CharField(verbose_name='title',max_length=32)
    def __str__(self):
        return self.title


class UserInfo(models.Model):
    name = models.CharField(verbose_name='name',max_length=32)
    gender_choices = (
        (0,'male'),
        (1,'female')
    )
    gender = models.BooleanField(verbose_name='gender')
    department = models.ForeignKey(Department,verbose_name='department',on_delete=models.SET_NULL, null=True, blank=True)
    password = models.CharField(verbose_name='password',max_length=64)
    age = models.IntegerField(verbose_name='age')
    salary = models.DecimalField(verbose_name='salary',max_digits=8,decimal_places=2,default=0)
    mobile = models.CharField(verbose_name='mobile',max_length=11)
    email = models.EmailField(verbose_name='email')
    image = models.ImageField(verbose_name='image',upload_to='static/upload')
    create_time = models.DateField(verbose_name='create_time',auto_now_add=False)


    def __str__(self):
        return self.name

class Admin(models.Model):
    name = models.CharField(verbose_name='name',max_length=32)
    # gender_choices = (
    #     (0,'male'),
    #     (1,'female')
    # )
    # gender = models.BooleanField(verbose_name='gender')
    # department = models.ForeignKey(Department,verbose_name='department',on_delete=models.SET_NULL, null=True, blank=True)
    password = models.CharField(verbose_name='password',max_length=64)
    # age = models.IntegerField(verbose_name='age')
    # salary = models.DecimalField(verbose_name='salary',max_digits=8,decimal_places=2,default=0)
    # mobile = models.CharField(verbose_name='mobile',max_length=11)
    # email = models.EmailField(verbose_name='email')
    # image = models.ImageField(verbose_name='image',upload_to='static/upload')
    # create_time = models.DateField(verbose_name='create_time',auto_now_add=False)